package com.springboot.demo.service;


import com.cx.item.common.service.BaseService;
import com.springboot.demo.model.example.CustomerExample;
import com.springboot.demo.model.model.Customer;
import com.springboot.demo.model.par.AddressAddOrUpdatePar;
import com.springboot.demo.model.par.UpdateCustomerPar;
import com.springboot.demo.model.vo.AddressDetailsVo;
import com.springboot.demo.model.vo.AddressListVo;
import com.springboot.demo.model.vo.CustomerDetailsVo;

import java.util.List;

public interface CustomerService extends BaseService<Customer, CustomerExample> {

    /**
     * 初始化用户token保存在redis缓存
     *
     * @return
     */
    long initCustomerToken();

    Customer getCustomerByOpenId(String openId);

    /**
     * 资料完整度计算
     * 计算资料包括手机号，头像，昵称，真实姓名，身份证，家庭住址，已经填写的资料个数/6 x 100%，不需要保留小数点
     * 30.3%为 30%
     *
     * @param customerId
     * @return
     */
    String computeDataPercent(int customerId);

    int updateCustomer(UpdateCustomerPar updateCustomerPar);

    CustomerDetailsVo getCustomerDetails(Integer customerId);

    AddressDetailsVo getAddressDetails(Integer addressId);

    int updateAddress(AddressAddOrUpdatePar addressAddOrUpdatePar);

    List<AddressListVo> getAddressList(Integer customerId);

    int addAddress(AddressAddOrUpdatePar addressAddOrUpdatePar);
}